#lang racket

(require "stream-basics.rkt")

; values 

(define 1-to-10 (stream-enumerate-interval 1 10))

(define one (stream-car 1-to-10))

(define 2-to-10 (stream-cdr 1-to-10))

(define 2-to-11 (stream-map (lambda (x) (+ x 1)) 1-to-10))

(define five (stream-ref 1-to-10 4))

(define 2-to-10-even (stream-filter (lambda (x) (even? x)) 1-to-10))

;output

(display "stream?:\n")
(stream? 10)
(stream? 1-to-10)

(display "\nempty-stream:\n")
the-empty-stream

(display "\nstream-car:\n")
one

(display "\nstream-cdr:\n")
(display-stream 2-to-10)

(display "\nstream-null?:\n")
(stream-null? the-empty-stream)
(stream-null? 1-to-10)

(display "\nstream-cons:\n")
(display-stream 1-to-10)

(display "\nstream-map:\n")
(display-stream 2-to-11)

(display "\nstream-ref:\n")
five

(display "\nstream-for-each:\n")
(stream-for-each (lambda (x) (display x)) 1-to-10)

(display "\n\nstream-filter:\n")
(display-stream 2-to-10-even)

(display "\ndisplay-stream:\n")
(display-stream 1-to-10)

(display "\nstream-enumerate-interval:\n")
(display-stream 1-to-10)